﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ModelLayer;
using DBLayer;
using CTRLayer;

namespace Test
{
    class Program
    {
        static void Main(string[] args)
        {
            //TypeTest();
            //customerTest();
            //cityTest();
            //seatTest();
            //CreateBookingTest();
            //CreatePartBookingTest();
            //UpdateBookingTest();
            //GetBookingTest();
            //GetPartBookingTest();


        }
        public static void GetPartBookingTest()
        {
            DBPartBooking dbPart = new DBPartBooking();
            PartBooking part;
            Show s = new CTRShow().GetShow(1);
            part = dbPart.GetPartBooking(1,s);
            Console.WriteLine("part id: " + part.Id.ToString());
            Console.ReadKey();

        }


        public static void GetBookingTest()
        {
            DBBooking dbBooking = new DBBooking();
            Booking b;

            b = dbBooking.GetBooking(1);
            Console.WriteLine(b.ToString());
            Console.ReadKey();
        }

        public static void UpdateBookingTest()
        {
            DBBooking dbBooking = new DBBooking();
            DBPartBooking dbPart = new DBPartBooking();
            Show s = new CTRShow().GetShow(1);

            int bookingId;
            int partId;
            bookingId = dbBooking.CreateBooking(1111111114, 20);
            partId = dbPart.CreatePartBooking(s);
            if (dbBooking.UpdateBooking(bookingId, partId, false))
            {
                Console.WriteLine("Update succes");
                Console.ReadKey();
            }
            else
            {
                Console.WriteLine("Update fail");
                Console.ReadKey();
            }
        }


        public static void CreatePartBookingTest()
        {
            DBPartBooking dbPart = new DBPartBooking();
            int partId = 0;
            Show s = new CTRShow().GetShow(1);
            partId = dbPart.CreatePartBooking(s);
            Console.WriteLine("pb" + partId);
            Console.ReadKey();

        }

        public static void CreateBookingTest()
        {
            DBBooking dbBooking = new DBBooking();
            int bookingId = 0;


            bookingId = dbBooking.CreateBooking(1111111114, 30);
            Console.WriteLine(bookingId);
            Console.ReadKey();

        }

        public static void TypeTest()
        {
            DBShowType dbType = new DBShowType();
            ShowType st = null;

            st = dbType.GetTypeOnShowId(1);
            Console.WriteLine(st.Title);
            Console.ReadKey();

        }
        public static void customerTest()
        {
            DBCustomer dbcus = new DBCustomer();
            Customer cus = null;

            cus = dbcus.GetCustomerByPhoneNo("87654321");
            Console.WriteLine(cus.FName);
            Console.ReadKey();

        }
        public static void cityTest()
        {
            DBCity dbc = new DBCity();
            City city = new City();

            city = dbc.RetrieveCity(9000);
            Console.WriteLine(city.CityName);
            Console.ReadKey();
        }


        public static void seatTest()
        {
            DBSeat dbSeat = new DBSeat();
            Seat s = new Seat();

            s = dbSeat.GetSeat(2);
            Console.WriteLine(s.SeatId);
            Console.WriteLine(s.Status);

            Console.ReadKey();
        }
    }
}
